home *** CD-ROM | disk | FTP | other *** search
GW-BASIC | 1997-01-29 | 4.0 KB | 156 lines |
- 10 'TINYCOIL - Coils Wound on Nylon Screws - 07 JUN 96 rev. 28 SEP 96
- 20 IF EX$=""THEN EX$="EXIT"
- 30 CLS:KEY OFF
- 40 COLOR 7,0,1
- 50 U$="#####.###"
- 60 UL$=STRING$(80,205)
- 70 DIM GA(40)
- 80 DIM T$(9,3)
- 90 '
- 100 DATA 8,32,.164, 10,24,.19, 1/4,20,.25
- 110 DATA 5/16,18,.3125, 3/8,16,.375, 1/2,13,.5
- 120 DATA 5/8,11,.625, 3/4,10,.75, 1,8,1
- 130 FOR Z=1 TO 9:FOR Y=1 TO 3:READ T$(Z,Y):NEXT Y:NEXT Z
- 140 '
- 150 '.....AWG calculator
- 160 K=(0.46/0.005)^(1/39) 'increment multiplier
- 170 FOR Z=1 TO 40
- 180 N=Z+3
- 190 GA(Z)=0.46/K^N
- 200 NEXT Z
- 210 '
- 220 '.....start
- 230 CLS
- 240 COLOR 15,2
- 250 PRINT " TINY COILS - wound on Nylon screws";
- 260 PRINT TAB(57)"by George Murphy VE3ERP ";
- 270 COLOR 1,0:PRINT STRING$(80,223);
- 280 COLOR 7,0
- 290 GOSUB 1190 'preface
- 300 COLOR 0,7:LOCATE ,22
- 310 PRINT " Press 1 to continue or 0 to EXIT....."
- 320 COLOR 7,0
- 330 Z$=INKEY$:IF Z$=""THEN 330
- 340 IF Z$="0"THEN CLS:RUN EX$
- 350 IF Z$="1"THEN 450
- 360 GOTO 30
- 370 GOTO 450
- 380 '
- 390 '.....format input line
- 400 IF ZZ=AWG THEN X$="#####"ELSE X$=U$
- 410 LOCATE CSRLIN-1:PRINT SPC(7);
- 420 LOCATE CSRLIN,47:PRINT STRING$(7,".");USING X$;ZZ;
- 430 RETURN
- 440 '
- 450 '.....input data
- 460 VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
- 470 INPUT " ENTER: Inductance...............................(>H)";UH
- 480 ZZ=UH:GOSUB 390:PRINT " >H"
- 490 INPUT " ENTER: Wire gauge (range #10 to #28 AWG).......(AWG)";AWG
- 500 ZZ=AWG:GOSUB 390:PRINT " AWG bare wire"
- 510 WD=GA(AWG)
- 520 PRINT " Wire diameter................................";USING U$;WD;
- 530 PRINT CHR$(34)
- 540 FOR Z=1 TO 9
- 550 T=VAL(T$(Z,2)) 'threads per inch
- 560 P=1/T 'pitch
- 570 IF P>WD AND P-WD>=0.015 THEN 630
- 580 NEXT Z
- 590 BEEP:PRINT " WIRE TOO LARGE.....Press any key....."
- 600 IF INKEY$=""THEN 600
- 610 GOTO 450
- 620 '
- 630 OD=VAL(T$(Z,3))
- 640 IF P<=(2.5*WD)THEN 690
- 650 BEEP:PRINT " WIRE TOO SMALL.....Press any key....."
- 660 IF INKEY$=""THEN 660
- 670 GOTO 450
- 680 '
- 690 PRINT " Coil form - use screw size...................";USING U$;OD;
- 700 PRINT CHR$(34);" ";T$(Z,1);"-";T$(Z,2);" thread"
- 710 PRINT " Screw thread pitch = coil turn spacing =.....";USING U$;P;
- 720 PRINT CHR$(34)
- 730 V=P/2-0.0625*P
- 740 H=SQR(3)*V
- 750 D=2*(OD/2-H+WD)
- 760 PRINT " Coil pitch diameter..........................";USING U$;D;
- 770 PRINT CHR$(34)
- 780 '
- 790 R=D/2
- 800 Q=R^2*T^2/UH
- 810 L=ABS(-10-SQR(100+36*R*Q))/2/Q
- 820 PRINT " Coil length..................................";USING U$;L;
- 830 PRINT CHR$(34)
- 840 N=L*T
- 850 PRINT " Number of turns..............................";USING U$;N;
- 860 GAP=P-WD
- 870 PRINT " Gap between turns............................";USING U$;GAP;
- 880 PRINT CHR$(34)
- 890 X$="#####"
- 900 PRINT " Turns per inch...............................";USING X$;T;
- 910 LD=L/D
- 920 PRINT " Length-to-diameter ratio.....................";
- 930 IF LD>4 THEN COLOR 14,6
- 940 PRINT USING "#####.##:1 ";LD
- 950 COLOR 7,0
- 960 AMT=INT(3.14159*D*N+4)+1
- 970 PRINT " Amount of wire required (including leads)....";USING X$;AMT;
- 980 PRINT CHR$(34)
- 990 PRINT
- 1000 IF LD>4 THEN BEEP:GOSUB 1040:GOTO 1390
- 1010 IF LD<0.4 THEN BEEP:GOSUB 1140:GOTO 1390
- 1020 GOTO 1390
- 1030 '
- 1040 PRINT TAB(M);
- 1050 COLOR 14,0
- 1060 PRINT "Most amateur radio applications require a length-to-diameter ratio"
- 1070 PRINT TAB(M);
- 1080 PRINT "of about 4:1 or less. If the ratio shown above is more than 4:1"
- 1090 PRINT TAB(M);
- 1100 PRINT "you might want to try again, selecting a larger wire size."
- 1110 COLOR 7,0
- 1120 RETURN
- 1130 '
- 1140 PRINT TAB(M);
- 1150 PRINT "Length-to-diameter ratio must be 0.4:1 or greater. Try again,"
- 1160 PRINT TAB(M);
- 1170 PRINT "using a smaller wire size."
- 1180 RETURN
- 1190 '.....preface
- 1200 M=7
- 1210 PRINT TAB(M);
- 1220 PRINT "Nylon screws make excellent small low-loss coil forms, providing"
- 1230 PRINT TAB(M);
- 1240 PRINT "automatic turn spacing for those of us who are all thumbs and fuzzy"
- 1250 PRINT TAB(M);
- 1260 PRINT "vision when it comes to winding tiny coils."
- 1270 PRINT
- 1280 PRINT TAB(M);
- 1290 PRINT "You can also make air-core coils by winding bare wire on a metal"
- 1300 PRINT TAB(M);
- 1310 PRINT "screw, then coat the entire coil with a liberal application of"
- 1320 PRINT TAB(M);
- 1330 PRINT "hot-melt glue. When the glue has cooled to a solid mass remove the"
- 1340 PRINT TAB(M);
- 1350 PRINT "screw by unscrewing it from the coil."
- 1360 PRINT
- 1370 RETURN
- 1380 '
- 1390 '.....end
- 1400 GOSUB 1430
- 1410 GOTO 220
- 1420 '
- 1430 'HARDCOPY
- 1440 GOSUB 1550:LOCATE 25,2:COLOR 14,6
- 1450 PRINT " Press 1 to print screen, 2 to print screen & ";
- 1460 PRINT "advance paper, or 3 to continue.";:COLOR 7,0
- 1470 Z$=INKEY$:IF Z$="3"THEN GOSUB 1550:RETURN
- 1480 IF Z$="1"OR Z$="2"THEN GOSUB 1550:GOTO 1500
- 1490 GOTO 1470
- 1500 FOR QX=1 TO 24:FOR QY=1 TO 80
- 1510 LPRINT CHR$(SCREEN(QX,QY));
- 1520 NEXT QY:NEXT QX
- 1530 IF Z$="2"THEN LPRINT CHR$(12)
- 1540 GOTO 1440
- 1550 LOCATE 25,1:PRINT STRING$(80,32);:RETURN
-